﻿<template>
  <div class="create">
    <ul>
      <li v-for="(item, index) in createList" :key="index">
        <div>{{ item.add_time }}</div>
        <div>
          <div>
            <img :src="item.thumb" alt="" />
          </div>
          <p>{{ item.title }}</p>
          <p>活动时间：{{ item.publish_time }}</p>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
import md5 from "js-md5";
import qs from "qs";
import { Toast } from "vant";
export default {
  data() {
    return {
      createList: "",
    };
  },
  created() {
    let timestamp = (Date.parse(new Date()) / 1000).toString();
    // console.log(timestamp);
    let _token =
      "userId=" +
      window.user_id +
      "&token=" +
      window.userToken +
      "&time=" +
      timestamp +
      "&wPQvCAOU$lbIyg9o2wVg0Dt1k^zy&SaX";
    let params = {
      userId: window.user_id,
      time: timestamp,
      token: window.userToken,
      sign: md5(_token),
    };
    //获取用户信息
    this.$axios
      .post("/video/activityList", qs.stringify(params))
      .then((res) => {
        console.log(res.data.result);
        this.createList = res.data.result;
      })
      .catch((err) => {
        console.log(err);
      });
  },
  methods: {},
};
</script>
<style>
.create {
  width: 100vw;
  height: 100vh;
  background: #f6f7f9;
}
.create > ul {
  width: 90.3vw;
  overflow: hidden;
  margin-left: 4.85vw;
}
.create > ul > li {
  width: 90.3vw;
  margin-top: 4.8vw;
}
.create > ul > li > div:nth-child(1) {
  height: 4.8vw;
  line-height: 4.8vw;
  text-align: center;
  width: 20.8vw;
  margin-left: 34.75vw;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 1vw;
  font-size: 2.9vw;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #ffffff;
}
.create > ul > li > div:nth-child(2) {
  background: white;
  margin-top: 2.4vw;
  border-radius: 1.9vw;
  padding-bottom: 3.6vw;
}
.create > ul > li > div:nth-child(2) > div {
  width: 90.3vw;
}
.create > ul > li > div:nth-child(2) > div img {
  width: 90.3vw;
}
.create > ul > li > div:nth-child(2) > p:nth-of-type(1) {
  margin-left: 3.4vw;
  margin-top: 2.9vw;
  font-size: 3.9vw;
  font-family: PingFangSC-Medium, PingFang SC;
  font-weight: 500;
  color: #333333;
}
.create > ul > li > div:nth-child(2) > p:nth-of-type(2) {
  margin-top: 1.9vw;
  margin-left: 3.4vw;
  font-size: 3.4vw;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #7d7d7f;
}
</style>